<style>
    DIV#content DIV.compactRadioGroup {
        padding-left: 1em;
    }

    DIV#content .compactRadioGroup LABEL,
    DIV#content .compactRadioGroup INPUT {
        display: inline;
    }
</style>
<?php
$model = new BDynamicFormModel();
$roleIdField = 'media_roleId_priceAdjust_role';
$model->addField($roleIdField);

$form = $this->beginWidget('CActiveForm', array(
    "id" => "manage-bookableRole-form",
    'enableAjaxValidation' => FALSE,
    'htmlOptions' => array('class' => 'form-horizontal', 'role' => 'form'),
        ));
?>

<p class="text-right"><?php
    echo $control->getAjaxLink(
            array('name' => '价格调整列表', 'id' => 'showPriceAdjustList'), array(
        'bookableId' => $bookableId
    ));
    ?>|
    <?php
    if ($priceAdjustId > 0) {
        echo $control->getAjaxLink(array('name' => '设置价格调整', 'id' => 'showAddPriceAdjust'), array(
            'bookableId' => $bookableId,
            'priceAdjustId' => $priceAdjustId
        ));
    }
    ?>|
    <?php
    if ($priceAdjustId > 0) {
        echo $control->getAjaxLink(array('name' => '会员价列表', 'id' => 'showRoleList'), array(
            'bookableId' => $bookableId,
            'priceAdjustId' => $priceAdjustId
        ));
    }
    ?>|
    <?php
    if ($priceAdjustId > 0) {
        echo $control->getAjaxLink(array('name' => '最后价格表', 'id' => 'showFinalPriceList'), array(
            'bookableId' => $bookableId,
            'priceAdjustId' => $priceAdjustId
        ));
    }
    ?>|
    添加会员
</p>
<?php if (isset($addRoleResult)) { ?>
    <?php
    if ($addRoleResult == 'success') {
        echo '<p class="bg-success">add child role successfully!</p>';
    } else {
        echo '<p class="bg-danger">add child role fail!</p>';
    }
    ?>
<?php } ?>

<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
    <?php if (isset($adminRoleData)) { ?>
        <div class="panel panel-default">
            <div class="panel-heading" role="tab" id="headingOne">
                <h4 class="panel-title">
                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
                        选择享受调整价格的管理员角色
                    </a>
                </h4>
            </div>
            <div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
                <div class="panel-body">
                    <?php
                    echo CHtml::activeRadioButtonList($model, $roleIdField, $adminRoleData);
                    ?>
                </div>
            </div>
        </div>
    <?php } ?>
    <?php if (isset($memberRoleData)) { ?>
        <div class="panel panel-default">
            <div class="panel-heading" role="tab" id="headingTwo">
                <h4 class="panel-title">
                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="true" aria-controls="collapseTwo">
                        选择享受调整价格的工作成员角色
                    </a>
                </h4>
            </div>
            <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
                <div class="panel-body">
                    <?php
                    echo CHtml::activeRadioButtonList($model, $roleIdField, $memberRoleData);
                    ?>
                </div>
            </div>
        </div>
    <?php } ?>
    <?php if (isset($customerRoleData)) { ?>
        <div class="panel panel-default">
            <div class="panel-heading" role="tab" id="headingThree">
                <h4 class="panel-title">
                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="true" aria-controls="collapseThree">
                        选择享受调整价格的客户角色
                    </a>
                </h4>
            </div>
            <div id="collapseThree" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingThree">
                <div class="panel-body">
                    <?php
                    echo CHtml::activeCheckBoxList($model, $roleIdField, $customerRoleData, array(
                        'separator'=>'',
                        'template' => "<div class='checkbox'>{input}{label}</div>"
                    ));
                    ?>
                </div>
            </div>
        </div>
    <?php } ?>
</div>
<div class="submit"> 
    <?php
    echo $control->getAjaxLink(
            array('name' => '添加角色', 'id' => 'addRole'), array(
                'bookableId'=>$bookableId,
                'priceAdjustId'=>$priceAdjustId,
        'htmlOptions' => array(
            'class' => 'btn')));
    ?>        
</div>
<?php $this->endWidget(); ?>